﻿using System.Configuration;
using System.Web.Mvc;
using ThemedViewEngine.Entity;

namespace MyCroft.Infrastructure
{
    public class Register
    {
        public static void RegisterViewEngine(ViewEngineCollection viewEngines)
        {
            viewEngines.Clear();
            var basePath = ConfigurationManager.AppSettings["ThemeBasePath"];
            var themeName = ConfigurationManager.AppSettings["ThemeName"];
            var theme = new Theme(basePath, themeName);
            var themeableRazorViewEngine = new ThemedRazorViewEngine(theme);
            viewEngines.Add(themeableRazorViewEngine);
        }
    }
}